#ifndef THREAD_SEARCH_LOGGER_BASE_H
#define THREAD_SEARCH_LOGGER_BASE_H

#include "InsertIndexManager.h"

class wxWindow;
class wxPanel;
class wxPoint;
class wxEvtHandler;
class ThreadSearch;
class ThreadSearchView;
class ThreadSearchEvent;
class ThreadSearchFindData;

class ThreadSearchLoggerBase {
  public:
    enum eLoggerTypes {
      TypeList = 0,
      TypeTree
    };
    static ThreadSearchLoggerBase* BuildThreadSearchLoggerBase( ThreadSearchView& threadSearchView,
        ThreadSearch& threadSearchPlugin,
        eLoggerTypes loggerType,
        InsertIndexManager::eFileSorting fileSorting,
        wxPanel* pParent,
        long id );
    virtual ~ThreadSearchLoggerBase() {}
    eLoggerTypes virtual GetLoggerType() = 0;
    virtual void Update();
    virtual void OnThreadSearchEvent( const ThreadSearchEvent& event ) = 0;
    virtual void Clear() = 0;
    virtual void OnSearchBegin( const ThreadSearchFindData& findData ) = 0;
    virtual void OnSearchEnd() {};
    virtual wxWindow* GetWindow() = 0;
    virtual void SetFocus()  = 0;
  protected:
    ThreadSearchLoggerBase( ThreadSearchView& threadSearchView, ThreadSearch& threadSearchPlugin, InsertIndexManager::eFileSorting fileSorting )
      : m_ThreadSearchView( threadSearchView )
      , m_ThreadSearchPlugin( threadSearchPlugin )
      , m_IndexManager( fileSorting ) {}

    virtual void ConnectEvents( wxEvtHandler* pEvtHandler ) = 0;
    virtual void DisconnectEvents( wxEvtHandler* pEvtHandler ) = 0;
    void ShowMenu( const wxPoint& point );
    ThreadSearchView& m_ThreadSearchView;
    ThreadSearch& m_ThreadSearchPlugin;
    InsertIndexManager m_IndexManager;
};

#endif
